package com.zhehekeji.opsys.api.plugin.wechat.webservice;

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;

import org.apache.cxf.rs.security.cors.CrossOriginResourceSharing;

import com.zhehekeji.opsys.api.plugin.wechat.rsp.AccessTokenRsp;
import com.zhehekeji.opsys.api.plugin.wechat.rsp.QrcodeShowRsp;

/**
 * @ClassName WechatManager
 * @Description TODO
 * @author chenweiliu chenwei.liu@163.com
 * @date 2018-1-3   上午10:53:49
 */
@Path(value="/")
@WebService
@CrossOriginResourceSharing(allowAllOrigins=true)
public interface WechatManager {
	
	@GET
	@Path(value="getAccessToken")
	@Produces(value=MediaType.APPLICATION_JSON )
	@WebMethod(action="doGetAccessToken",operationName="getAccessToken")
    AccessTokenRsp getAccessToken();
	
	/**
	 * 获取微信带参数二维码图片
	 * @param activityCode 活动编码
	 * @param userID 用户账号
	 * @return
	 */
	@GET
	@Path(value="getQrcodeShow")
	@Produces(value=MediaType.APPLICATION_JSON )
	@WebMethod(action="doGetQrcodeShow",operationName="getQrcodeShow")
    QrcodeShowRsp getQrcodeShow(@WebParam(name="activityCode")@QueryParam(value="activityCode")String activityCode,
                                @WebParam(name="userID")@QueryParam(value="userID")String userID,
                                @WebParam(name="limitWinNum")@QueryParam(value="limitWinNum")int limitWinNum);
	
	/**
	 * 获取微信带参数二维码图片
	 * 明文：activityCode=xxx&userID=xxx&timestamp=xxx&key=xxx
	 * 加密：DESede(明文,key)
	 * @param sign
	 * @return
	 */
	@GET
	@Path(value="getSafeQrcodeShow")
	@Produces(value=MediaType.APPLICATION_JSON )
	@WebMethod(action="doGetSafeQrcodeShow",operationName="getSafeQrcodeShow")
	QrcodeShowRsp getSafeQrcodeShow(@WebParam(name="sign")@QueryParam(value="sign")String sign);
}

